<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" type="text/css" href="login.css">
 
    <title>信息录入</title>
 <style >
  *{
	margin: 0;
	padding: 0;
}
a{
	text-decoration: none;
	color: #0366d6;
}
body{
	background:url(img/timg.jpg)no-repeat;
        background: url(img/timg.jpg) no-repeat center center fixed;
	-webkit-background-size: cover;
	-moz-background-size: cover;
	-o-background-size: cover;
	background-size: cover;
}
#content{
	width: 100%;
	font-size: 18px;
	text-align: center;
}
form{
	width: 250px;
	margin: 150px auto 20px auto;
	line-height: 30px;
	padding: 50px;
	border: 1px solid #d8dee2;
	background: #fff;
}
form input{
	border-radius: 3px;
	width: 230px;
	height: 21px;
	margin-bottom: 20px;
	padding: 6px;
	font-size: 14px;
	background-color: rgb(250, 255, 189);
	border-color: rgb(209, 213, 218);
	border-style: solid;
}
input[type="button"]{
	width: 250px;
	height: 41px;
	font: 18px monospace;
	letter-spacing: 1px;
	color: #fff;
	background-color: #0f88eb;
	border: 0;
	border-radius: 3px;
	margin-bottom: 10px;
}
form .extra{
	width: 255px;
	font-size: 16px;
}
.extra a{
	float: right;
}
.register{
	width: 250px;
	text-align: center;
	margin: 0 auto;
	line-height: 20px;
	padding: 15px 50px 15px 50px;
	border: 1px solid #d8dee2;
	font-family: '宋体';
    font-size: 14px;
    letter-spacing: 2px;
    color: rgb(36, 41, 46);
}
  
</style>
<script type="text/javascript" >
		function getXmlHttpObject(){
			var xmlHttpRequest;
			if(window.ActiveXObject){
			}else{
				xmlHttpRequest=new XMLHttpRequest();
			}
			return xmlHttpRequest;
		}
		function addStudentScore(){
			myXmlHttpRequest=getXmlHttpObject();
			if(myXmlHttpRequest){
					var stunum=document.getElementById("stunum").value;
					var teanum=document.getElementById("teanum").value;
					var coursename=document.getElementById("coursename").value;
					var score=document.getElementById("score").value;
					var url="http://localhost:8080/StuScoreSystem/Teacher?method=insertScore&&stunum="+stunum+"&&teanum="+teanum+"&&coursename="+coursename+"&&score="+score+"";
					//var url="http://localhost:8080/StuScoreSystem/Login?method=adminLogin&&username=admin&&password=123";
					myXmlHttpRequest.open("get",url,true);
					myXmlHttpRequest.onreadystatechange=progress;
					myXmlHttpRequest.send(null);
			}
			else{
				window.alert("error");
			}
		}
		function progress(){
			if(myXmlHttpRequest.readyState==4){
				var json=myXmlHttpRequest.responseText;
				var json_obj=eval("("+json+")");
					//var json1=JSON.parse(json);
				var state_obj=json_obj.meta;
				window.alert(state_obj.state);
				window.close();
			}
		}
</script>
</head>
<body>
	<div id="content">
	<form>
	    <input id="teanum" type="text"placeholder="教师编号"required>
		<input id="stunum" type="text"autocomplete="off"placeholder="学生学号"required>
		<input id="coursename" type="text"autocomplete="off"placeholder="课程名"required>
		<input id="score" type="text"placeholder="成绩"required>
	    <input type="button" onclick="addStudentScore()" value="录入"></input>

	</form>
	</div>
</body>
</html>